home *** CD-ROM | disk | FTP | other *** search
/ 3D World 110 / 3DW_110.iso / mac / Menu / Scenes / home.dir / 00042_Script_Open Media Player Rose < prev    next >
Text File  |  2008-09-12  |  3KB  |  141 lines

  1. property Sp
  2. property spriteList
  3. property pRadius
  4. property RoseOpen
  5. property rosemode
  6. property tc
  7. property bWidth
  8. property fWidth
  9. property aRad
  10. property degMod
  11. property aDegMod
  12.  
  13. on beginsprite me
  14.  
  15.   Sp = sprite(me.spritenum)
  16.   tc = 0
  17.   bWidth = 60
  18.   fWidth = 100
  19.   
  20.   degMod = 90
  21.   aRad = 0
  22.   Sp.width = bWidth
  23.   Sp.height = bWidth
  24.   
  25.   sprite(Sp).member.centerRegPoint = true
  26.   pRadius = 70
  27.   RoseOpen = false
  28.   SpriteList = [:]
  29.   SpriteList = [sprite(22),sprite(23),sprite(24),sprite(25),sprite(26)]
  30.   repeat with i = 1 to spriteList.count
  31.     SpriteList[i].loc = Sp.loc
  32.     SpriteList[i].visible = false
  33.     SpriteList[i].member.centerregPoint = true
  34.   end repeat
  35. end
  36.  
  37. on Exitframe me
  38.   if RoseOpen = false then
  39.     if mGetDistance(the mouseLoc, Sp.loc) < pRadius then
  40.       
  41.       OpenRose
  42.       RoseOpen = true
  43.     end if
  44.   end if
  45.   
  46.   if (RoseOpen) then
  47.     if mGetDistance(the mouseLoc, Sp.loc) > pRadius + 20 then
  48.       
  49.       CloseRose
  50.       RoseOpen = false
  51.     end if
  52.   end if
  53.   
  54.   ----Rose Scaling + Rotating Stuff Here
  55.   
  56.   case RoseMode of
  57.     "exp":
  58.       
  59.       if tc <> 1.0 then
  60.         
  61.         tc = tc + 0.2
  62.         Sp.width = bWidth + float((fWidth - bWidth) * tc)
  63.         Sp.height = bWidth + float((fWidth - bWidth) * tc)
  64.         aDegMod = degMod * tc
  65.         aRad = pRadius * tc
  66.       else
  67.         RoseMode = "Open"
  68.         Sp.width = 89
  69.         Sp.height = 90
  70.         repeat with i = 1 to SpriteList.count
  71.           SpriteList[i].visible = true
  72.         end repeat
  73.         put tc
  74.         
  75.       end if
  76.       
  77.     "shk":
  78.       
  79.       if tc > 0.00 then
  80.         tc = tc - 0.2
  81.         Sp.width = bWidth + float((fWidth - bWidth) * tc)
  82.         Sp.height = bWidth + float((fWidth - bWidth) * tc)
  83.         aDegMod = degMod * tc
  84.         aRad = pRadius * tc
  85.       else
  86.         RoseMode = "closed"
  87.         repeat with i = 1 to SpriteList.count
  88.           SpriteList[i].visible = false
  89.         end repeat
  90.       end if
  91.   end case
  92.   
  93.   baseLoc = point(Sp.Loch, Sp.locv)
  94.   deg = 360 / SpriteList.count
  95.   repeat with o = 1 to SpriteList.count
  96.     SpLoc = getXYpos(vector(BaseLoc.loch, BaseLoc.locv,0), (deg*(o-1)) - adegmod, aRad)
  97.     SpriteList[o].loc = point(SpLoc.x, SpLoc.y)
  98.     SpriteList[o].blend = (tc * 100)
  99.   end repeat
  100. end
  101.  
  102.  
  103.  
  104. on CloseRose
  105.   tc = 1.00
  106.   RoseMode = "shk"
  107. end
  108.  
  109.  
  110.  
  111. on OpenRose
  112.   repeat with i = 1 to SpriteList.count
  113.     SpriteList[i].visible = true
  114.     SpriteList[i].blend = 0
  115.   end repeat
  116.   tc = 0
  117.   RoseMode = "exp"
  118. end
  119.  
  120.  
  121.  
  122.  
  123. on getXYPos Origin, ang, dist
  124.   myA = degreesToRads(ang)
  125.   return vector((origin.x + (dist * cos(myA))), (origin.y + (dist * sin(myA))), 0)
  126. end
  127.  
  128. on degreesToRads aAngle
  129.   return aAngle * PI/180
  130. end 
  131.  
  132. on mGetDistance aPoint, AnotherPoint
  133.   --- Returns Distance between aPoint and AnotherPoint as a floating point number.
  134.   pDistance = sqrt(power((aPoint.locH - AnotherPoint.locH), 2) + power((aPoint.locV - AnotherPoint.locV), 2))
  135.   return pDistance
  136. end
  137.  
  138.  
  139.  
  140.  
  141.